package com.visizen.wisdomclass.server.client;

import com.visizen.wisdomclass.server.model.WcShcool;
import com.visizen.wisdomclass.server.model.WcShcoolExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface WcShcoolMapper {
    @SelectProvider(type=WcShcoolSqlProvider.class, method="countByExample")
    int countByExample(WcShcoolExample example);

    @DeleteProvider(type=WcShcoolSqlProvider.class, method="deleteByExample")
    int deleteByExample(WcShcoolExample example);

    @Delete({
        "delete from wc_shcool",
        "where GROUP_ID = #{GROUP_ID,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long GROUP_ID);

    @Insert({
        "insert into wc_shcool (GROUP_ID, DISTRICT_ID, ",
        "GROUP_NAME, DESCIPTION)",
        "values (#{GROUP_ID,jdbcType=BIGINT}, #{DISTRICT_ID,jdbcType=VARCHAR}, ",
        "#{GROUP_NAME,jdbcType=VARCHAR}, #{DESCIPTION,jdbcType=VARCHAR})"
    })
    int insert(WcShcool record);

    @InsertProvider(type=WcShcoolSqlProvider.class, method="insertSelective")
    int insertSelective(WcShcool record);

    @SelectProvider(type=WcShcoolSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="GROUP_ID", property="GROUP_ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="DISTRICT_ID", property="DISTRICT_ID", jdbcType=JdbcType.VARCHAR),
        @Result(column="GROUP_NAME", property="GROUP_NAME", jdbcType=JdbcType.VARCHAR),
        @Result(column="DESCIPTION", property="DESCIPTION", jdbcType=JdbcType.VARCHAR)
    })
    List<WcShcool> selectByExample(WcShcoolExample example);

    @Select({
        "select",
        "GROUP_ID, DISTRICT_ID, GROUP_NAME, DESCIPTION",
        "from wc_shcool",
        "where GROUP_ID = #{GROUP_ID,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="GROUP_ID", property="GROUP_ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="DISTRICT_ID", property="DISTRICT_ID", jdbcType=JdbcType.VARCHAR),
        @Result(column="GROUP_NAME", property="GROUP_NAME", jdbcType=JdbcType.VARCHAR),
        @Result(column="DESCIPTION", property="DESCIPTION", jdbcType=JdbcType.VARCHAR)
    })
    WcShcool selectByPrimaryKey(Long GROUP_ID);

    @UpdateProvider(type=WcShcoolSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") WcShcool record, @Param("example") WcShcoolExample example);

    @UpdateProvider(type=WcShcoolSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") WcShcool record, @Param("example") WcShcoolExample example);

    @UpdateProvider(type=WcShcoolSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(WcShcool record);

    @Update({
        "update wc_shcool",
        "set DISTRICT_ID = #{DISTRICT_ID,jdbcType=VARCHAR},",
          "GROUP_NAME = #{GROUP_NAME,jdbcType=VARCHAR},",
          "DESCIPTION = #{DESCIPTION,jdbcType=VARCHAR}",
        "where GROUP_ID = #{GROUP_ID,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(WcShcool record);
}